<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //循环语句 continue break
    /**
     * continue终止本次循环，不影响后续循环执行
     * break终止整个循环，后续循环不再执行
    */
    //for
    for(var i=1;i<4;i++){
        console.log(i);
    }
    //while
    var i=1;
    while(i<3){
        document.write(i+"<br/>");
        i++;
    }
    //do while
    var i=1;
    do{
        document.write(i+"<br/>");
        i++;
    }while(i<3)
    //for continue
    for(var i=0;i<10;i++){
        if(i==5){
            console.log("本次不输出");
            continue;
        }
        console.log("当前循环i值为:"+i);
    }
    //while break
    j=0;
    while(j<10){
        if(j==5){
            break;
        }
        console.log("当前循环j值为:"+j);
        j++;
    }
</script>
</html>